package com.cn.ztest;

import java.io.UnsupportedEncodingException;

import org.junit.Test;

import com.cn.xc.utils.DecoderUtil;

/**
 * FUN:
 * 
 * @author sushy
 * @date 2016-3-24
 */
public class DecoderUtilTest {

	@Test
	public void testDecode() {
		String s = "德玛西亚，人在塔在";
		System.out.println("str=" + s);
		String str = s;
		try {
			str = new String(s.getBytes("UTF-8"), "ISO-8859-1");
		} catch (UnsupportedEncodingException e) {

			e.printStackTrace();
		}
		System.out.println("utf-8=" + DecoderUtil.decode(str));
		System.out.println("gb2312=" + DecoderUtil.decode(str, "gb2312"));
		System.out.println("IOS-8859-1=" + DecoderUtil.decode(str, "IOS-8859-1"));
		System.out.println("latin1=" + DecoderUtil.decode(str, "latin1"));

	}

}
